const mergeTwoLists = function(l1, l2) {

  // 定义头节点，确保链表可以访问到
  let head = new ListNode()
  // cur 这里就是那根针
  let cur = head

  while (l1 && l2) {
    // 如果l1的节点值较小
    if (l1.val <= l2.val) {
      cur.next = l1
      l1 = l1.next
    } else {
      cur.next = l2
      l2 = l2.next
    }
    cur = cur.next
  }

  cur.next = l1 !== null  ? l1 : l2;

  return head.next
}